package com.kgar.entity.graph.node;


import lombok.Data;
import org.springframework.data.neo4j.core.schema.Id;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Relationship;
import java.util.List;
import java.util.Objects;

@Node("User")
@Data
public class UserNode {
    @Id
    private Integer userId;

    private String userName;

    @Relationship(type = "HAS")
    private List<ResumeNode> resumeNodes;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserNode userNode = (UserNode) o;
        return Objects.equals(userId, userNode.userId) && Objects.equals(userName, userNode.userName) ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId, userName);
    }
}
